package com.yuhong.springbootinit.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuhong.springbootinit.service.CompanyPositionService;
import com.yuhong.springbootinit.model.entity.CompanyPosition;
import com.yuhong.springbootinit.mapper.CompanyPositionMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author 10467
* @description 针对表【company_position】的数据库操作Service实现
* @createDate 2025-02-22 13:52:10
*/
@Service
public class CompanyPositionServiceImpl extends ServiceImpl<CompanyPositionMapper, CompanyPosition>
    implements CompanyPositionService {


    @Resource
    private CompanyPositionMapper companyPositionMapper;

    @Override
    public String getCompanyIdByPositionId(String positionId) {

        QueryWrapper<CompanyPosition> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(CompanyPosition::getPositionId, positionId);

        CompanyPosition companyPosition = companyPositionMapper.selectOne(queryWrapper);

        return companyPosition.getCompanyId();
    }
}




